﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace WindowsUserControl.UIUpdateWrapper
{
    /// <summary>
    /// 
    /// </summary>
    public class CheckBoxUpdator
    {
        CheckBox _CheckBox;
        bool _Checked;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="ckbox"></param>
        /// <param name="isChecked"></param>
        public CheckBoxUpdator(CheckBox ckbox, bool isChecked)
        {
            this._CheckBox = ckbox;
            this._Checked = isChecked;
            this._CheckBox.Invoke(new MethodInvoker(this.UpdateCheckState));
        }

        private void UpdateCheckState()
        {
            this._CheckBox.Checked = this._Checked;
        }
    }
}
